#ifndef __zip_krnl_h__
#define __zip_krnl_h__
#include <cstdint.h>
#include "fs.h"
typedef struct zip_local_file_hdr {
	uint32_t magic;
	uint16_t version;
	uint16_t gpflags;
	uint16_t compression;
	uint16_t mod_time;
	uint16_t mod_date;
	uint32_t crc32_checksum;
	uint32_t compressed_size;
	uint32_t uncompressed_size;
	uint16_t filename_length;
	uint16_t extra_field_length;
	uint8_t filename_ptr;
} zip_lf_hdr_t;

typedef struct zip_extra_data_hdr {
	uint32_t magic;
	uint32_t length;
	uint8_t data_ptr;
} zip_ed_hdr_t;

typedef struct zip_central_dir_struct {
	uint32_t magic;
	uint16_t ver_made_by;
	uint16_t ver_needed;
	uint16_t gpflags;
	uint16_t compression;
	uint16_t mod_time;
	uint16_t mod_date;
	uint32_t crc32_checksum;
	uint32_t compressed_size;
	uint32_t uncompressed_size;
	uint16_t filename_length;
	uint16_t extra_field_length;
	uint16_t file_comment_length;
	uint16_t disk_start;
	uint16_t int_attribs;
	uint32_t ext_attribs;
	uint32_t local_hdr_off;
	uint8_t data_ptr;
} zip_cds_t;

typedef struct zip_signature{
	uint32_t magic;
	uint16_t size;
} zip_sig_t;

typedef void (*error_type_t)(const char *);

void krnl_zip_set_error(error_type_t);
void krnl_zip_extract_to(vfs_node_t *,void *source);
#endif